package variabilitysmelldetection.measurement.measures.spl;

import java.util.List;

import variabilitysmelldetection.measurement.measures.Measure;
import variabilitysmelldetection.measurement.measures.component.CouplingBetweenObjects;
import variabilitysmelldetection.measurement.models.ComponentItem;


public class TotalCouplingBetweenObjects extends Measure {

	public TotalCouplingBetweenObjects(){
		super("Total Coupling Between Objects", "TCBO");
	}
	
	@Override
	public void measure(List<ComponentItem> classes) {
		int value = 0;
		for (ComponentItem c : classes) {

			Measure measure = c.getMeasure(CouplingBetweenObjects.class);
			if (measure != null) {
				value += measure.getValue();
			}
		}
		setValue(value);
	}
}
